package com.gopay.bis.manager.bank.payconfig.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.bis.dao.payconfig.BisBankSmallMerchantsDao;
import com.gopay.bis.domain.order.SmallMerchants;
import com.gopay.bis.manager.bank.payconfig.BisBankSmallMerchantsManager;

@Service("bisBankSmallMerchantsManager")
public class BisBankSmallMerchantsManagerImpl implements BisBankSmallMerchantsManager {

    @Resource(name = "bisBankSmallMerchantsDao")
    private BisBankSmallMerchantsDao bisBankSmallMerchantsDao;

    @Override
    public boolean isEnableSmallMerchant(String merId) {
        List<SmallMerchants> list = bisBankSmallMerchantsDao.getEnableSmallMerchantsByMerId(merId);
        if (list != null && list.size() != 0) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean isEnableBankSmallMerchant(String merId, String bank) {
        List<SmallMerchants> list = bisBankSmallMerchantsDao.getEnableSmallMerchantsByMerIdBank(merId, bank);
        if (list != null && list.size() != 0) {
            return true;
        } else {
            return false;
        }
    }

    public BisBankSmallMerchantsDao getBisBankSmallMerchantsDao() {
        return bisBankSmallMerchantsDao;
    }

    public void setBisBankSmallMerchantsDao(BisBankSmallMerchantsDao bisBankSmallMerchantsDao) {
        this.bisBankSmallMerchantsDao = bisBankSmallMerchantsDao;
    }

}
